Skip to main content

Image

Last Update: 2025/3/26

The Qwen Image Generation API allows you to create images from textual descriptions using Qwen's DALL-E model. This document provides an overview of the API endpoints, request parameters, and response structure.

Endpoint

POST https://platform.llmprovider.ai/v1/images/generations

Request Headers

HeaderValue
AuthorizationBearer YOUR_API_KEY
Content-Typeapplication/json

Request Body

The request body should be a JSON object with the following parameters:

ParameterTypeDescription
modelstringThe model to use for image generation.
promptstringA text description of the desired image(s).
ninteger(Optional) The number of images to generate. Defaults to 1.
qualitystring(Optional) The quality of the generated images. Options: "standard" or "hd".
response_formatstring(Optional) The format of the generated images. Options: "url" or "b64_json".
sizestring(Optional) The size of the generated images. Options: "256x256", "512x512", "1024x1024", "1792x1024", "1024x1792".
stylestring(Optional) A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.
userstring(Optional) A unique identifier for tracking your requests.

Example Request

{
"model": "wanx-v1",
"prompt": "少女,高分辨率,增加细节,细节强化,侧面视角,森林,奶油风,暖色调,精致的脸部比例,精细的裙子,五官立体,长卷发,极高分辨率,清晰度强化,全身像,微笑,五颜六色的花瓣飞舞,自然光",
"size": "1024*1024",
"n": 1
}

Response Body

The response body will be a JSON object containing the generated images and related metadata.

FieldTypeDescription
createdintegerThe timestamp for when the image was created.
dataarrayAn array of generated image objects.

Example Response

{
"created": 1678891234,
"data": [
{
"url": "https://..."
},
{
"url": "https://..."
}
]
}

Example Request

curl -X POST https://platform.llmprovider.ai/v1/images/generations \
-H "Authorization: Bearer $YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wanx-v1",
"prompt": "A cute baby sea otter",
"n": 1,
"size": "1024*1024"
}'

For any questions or further assistance, please contact us at [email protected].